package com.ruoyi.web.controller.student;

import com.ruoyi.system.domain.StudentGrades;
import com.ruoyi.system.service.impl.StudentGradesServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/studentGrades")
public class StudentGradesController {
    @Autowired
    private StudentGradesServiceImpl studentGradesService;

    // 获取学生所有信息
    @PostMapping("/select")
    public List<StudentGrades> getAllStudentGrades(@RequestBody StudentGrades studentGrades) {
        List<StudentGrades> studentGrades1 = studentGradesService.getStudentGrades(studentGrades);
        return studentGrades1;
    }

    //添加学生信息
    @PostMapping("/addPost")

    public String addStudentGrades(@RequestBody StudentGrades studentGrades) {

        return studentGradesService.addStudentGrades(studentGrades);
    }

    //修改学生信息
    @PostMapping("/update")
    public String updateStudentGrades(@RequestBody StudentGrades studentGrades) {

        return studentGradesService.updateStudentGrades(studentGrades);
    }

    //删除学生信息

    @PostMapping("/delPost")

    public String deleteStudentGrades(@RequestBody StudentGrades studentGrades) {

        return studentGradesService.deleteStudentGrades(studentGrades);
    }



}
